using System;
using SubversionReports.Utilities;

namespace SubversionReports.Web
{
    public partial class _Default : Page
    {
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            PageFunction pageFunction;
            if (!SvnWebDav.AuthenticationSuceeded)
                pageFunction = PageFunction.RepositoryLogin;
            else
                pageFunction = PageFunction.RepositoryStats;

            RepositoryLogin1.Visible = pageFunction.Equals(PageFunction.RepositoryLogin);
            AuthorActivityGraph1.Visible = pageFunction.Equals(PageFunction.RepositoryStats);
        }

        enum PageFunction
        {
            RepositoryLogin,
            RepositoryStats
        }
    }
}
